Repository navigation
Conversation
chjpooh2002
approved these changes
Nov 13, 2026
chjpooh2002
left a comment
Contributor
There was a problem hiding this comment.
명세 13번과 대조해 봤는데 경로, 파라미터, TEMPLATE200_5, 응답 필드, 빈 값과 파라미터가 없을 때의 처리까지 명세와 같습니다. 판정에 Shortcut.findViolation과 기존 중복 조회 메서드를 그대로 써서 저장 API와 규칙이 어긋날 여지가 없는 점이 좋습니다. 테스트도 자모 분리형, 대소문자, 휴지통, 다른 회원, 자기 자신 제외까지 잘 챙겨 주신 거 같아요!
수고하셨습니다~~
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈
작업 내용
명세 13번
GET /api/v1/templates/shortcuts/availability. 단축어 입력이 멈추면 화면이 부르는 실시간 확인 API입니다. 형식 오류·예약어·중복도 에러가 아니라 200 +available: false+reason으로 내려줍니다.TEMPLATE200_5단축어 확인에 성공했습니다.result:shortcut,available,reason(사용 가능하면null)/톤교정) → 중복?shortcut=·?shortcut=/는 200 +INVALID_FORMAT(확인 API에는 빈 값 사유가 없음)existsByUserIdAndActiveShortcutKey(...AndIdNot) 그대로 사용excludeTemplateId가 있으면 그 ID만 빼고 판정. 남의 ID·휴지통 ID·없는 ID도 에러 없음shortcut없음·excludeTemplateId가 숫자 아님COMMON400_1, 토큰 없음COMMON401_1(스프링 기본 처리,global변경 없음)TemplateQueryService(readOnly), 회원 잠금 없음, 캐시no-storeShortcutUnavailableReason(template/entity):INVALID_FORMAT/RESERVED/DUPLICATED. 내부 값ShortcutViolation은from()으로 바꿔 내보냅니다 (EMPTY → INVALID_FORMAT)Shortcut한 곳: 위반은findViolation, 비교 키는Shortcut.create. 형식이 틀린 입력도 정규화한 값으로 돌려주려고Shortcut.normalize를 public으로 바꿨습니다 (정규식·예약어 복사 없음)명세와 달라진 점
없음. 명세에 없어 정한 것은 아래 "리뷰어에게" 1·2번입니다 (1번은 확정).
테스트
./gradlew build)TemplateShortcutAvailabilityControllerTest(통합, 24개): 필드 순서·no-store, 명세 예시처럼 인코딩한 주소, 자모 분리형(NFD)이 완성형과 같게 판정, NFD로 11자를 넘는 입력도 정규화 후 형식 검사, 휴지통 단축어는 사용 가능, 다른 회원의 같은 단축어는 중복 아님, 대소문자만 다른 중복, 자기 자신 제외, 다른 내 템플릿·남의·휴지통·없는 ID 제외, 형식 오류 8가지(빈 값·/포함)·예약어,excludeTemplateId=빈 값,shortcut없음·숫자 아닌 IDCOMMON400_1, 토큰 없음COMMON401_1TemplateQueryServiceTest(모키토): 사용 가능, 형식 오류·빈 값·/만·예약어(레포지토리 호출 없음), 중복, 대소문자만 다른 중복(소문자 키로 조회), 자기 자신 제외, NFD 정규화ShortcutUnavailableReasonTest(상수 이름 = 명세 값, 변환),ShortcutTest(normalize)확인 체크리스트
./gradlew build통과global공통 코드 변경 없음리뷰어에게
shortcut은 NFC 정규화한 값(대소문자는 입력 그대로)으로 확정했습니다. 명세는 "확인한 단축어"라고만 되어 있어 팀에서 정했습니다.excludeTemplateId가 숫자가 아니면COMMON400_1(경로 변수 ID와 같은 처리), 빈 값(excludeTemplateId=)은 없는 것으로 봅니다.🤖 Generated with Claude Code